package com.daJiao.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.daJiao.domain.BaseEntity;
import com.daJiao.domain.CreateValidate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "SysUser")
@TableName("sys_user")
public class SysUser extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -7949293189884985414L;

    /**
     * 用户名
     */
    @Length(min = 2, max = 32, message = "用户名长度为2到32个字符")
    @ApiModelProperty(value = "用户名")
    private String userName;

    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空", groups = {CreateValidate.class})
    @ApiModelProperty(value = "密码")
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private String password;

    /**
     * 真实姓名
     */
    @Length(min = 1, max = 32, message = "支持1到32个字符")
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    private String sex;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    private String mobile;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    private String email;


    /**
     * 状态
     */
    private Integer status;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    private String avatar;

}
